package com.suxin.plugin.intergration;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Tang
 * @classname RuntimeMode
 * @description [  ]
 * @date 2022/6/26 22:57
 */
public enum RuntimeMode {

    DEVELOPMENT("development", "dev"), // development
    DEPLOYMENT("deployment", "prod"); // deployment

    private final String name;
    private final String[] aliases;

    private static final Map<String, RuntimeMode> map = new HashMap<>();

    static {
        for (RuntimeMode mode : RuntimeMode.values()) {
            map.put(mode.name, mode);
            for (String alias : mode.aliases) {
                map.put(alias, mode);
            }
        }
    }

    RuntimeMode(final String name, final String... aliases) {
        this.name = name;
        this.aliases = aliases;
    }


}
